package xkp.lesson.converter;

import org.springframework.core.convert.converter.Converter;
import xkp.lesson.entity.Point;

public class PointConverter implements Converter<String, Point> {
    @Override
    public Point convert(String s) {
        String[] xy = s.split(",");
        Double x = Double.parseDouble(xy[0]);
        Double y = Double.parseDouble(xy[1]);
        return new Point(x,y);
    }
}
